﻿using Microsoft.AspNetCore.Mvc;
using Service.System;

namespace AnQinManagermentBackendAPI.Controller.System
{
    /// <summary>
    /// 附件上传
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class UploadController : ControllerBase
    {
        /**
         * 上传业务接口
         */
        private readonly UpLoadService _upLoadService;

        /**
         * 构造函数注入
         */
        public UploadController(UpLoadService upLoadService)
        {
            _upLoadService = upLoadService;
        }

        /// <summary>
        /// 上传附件
        /// </summary>
        [HttpPost]
        public async Task<string> FileUpload(IFormFile file)
        {
            return await _upLoadService.FileUpload(file);
            //return StatusCode(response.Status, response);
        }
    }
}
